import java.io.*;
import java.util.*;
import java.lang.*;

public class Two {
	public static void main(String[] args) {
		int x=0, y=1, sum=0, n=0;
		while (n<=4000000){
			n=x+y;
			x=y;
			y=n;
			if (n%2==0){
				sum=sum+n;
			}
		}
		System.out.println(sum);
	}
}
